package com.wt.admin.controller.ai;


import com.aizuda.easy.security.domain.Rep;
import com.aizuda.easy.security.domain.Req;
import com.wt.admin.domain.dto.ai.AgentsConfigDTO;
import com.wt.admin.domain.dto.ai.AgentsInfoDTO;
import com.wt.admin.domain.vo.ai.AgentsConfigVO;
import com.wt.admin.domain.vo.ai.AgentsInfoVO;
import com.wt.admin.domain.vo.sys.UserVO;
import com.wt.admin.service.ai.AgentsConfigService;
import com.wt.admin.service.ai.AgentsProxyService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("agents")
public class AgentsController {


    @Resource
    private AgentsProxyService agentsProxyService;
    @Resource
    private AgentsConfigService agentsConfigService;


    @PostMapping("infoList")
    public Rep<List<AgentsInfoVO>> infoList(@RequestBody Req<AgentsInfoDTO, UserVO> req) {
        return Rep.ok(agentsProxyService.getAgentsInfoService().infoList(req.getData()));
    }

    @PostMapping("infoEdit")
    public Rep<AgentsInfoVO> infoEdit(@RequestBody Req<AgentsInfoDTO, UserVO> req) {
        return Rep.ok(agentsProxyService.getAgentsInfoService().infoEdit(req.getData()));
    }

    @PostMapping("infoDel")
    public Rep<AgentsInfoVO> infoDel(@RequestBody Req<AgentsInfoDTO, UserVO> req) {
        return Rep.ok(agentsProxyService.getAgentsInfoService().infoDel(req.getData()));
    }

    @PostMapping("agentsConfig")
    public Rep<AgentsConfigVO> agentsConfig(@RequestBody Req<AgentsConfigDTO, UserVO> req) {
        return Rep.ok(agentsConfigService.agentsConfig(req.getData()));
    }

}
